package com.panku.controller;

import javax.servlet.http.HttpServletRequest;

import com.panku.entity.UserBean;
import com.panku.util.BeanUtil;

public class LoginController extends BaseController {

	@Override
	public String execute(HttpServletRequest request) {
		return "success";
	}
	
	
	public String login(HttpServletRequest request){
		UserBean ub= BeanUtil.reqToBean(UserBean.class, request);
		if(ub.getName().equals("jack")&&ub.getPass().equals("123")){
			request.setAttribute("msg", "登录成功!");
			return "success";
		}else{
			request.setAttribute("msg", "登录失败，用户名或密码错误~!");
			return "error";
		}
		
	}
	
	

}
